<?php
class Cate_design_Model extends ORM {
	
	protected $table_name = 'cate_design';
	protected $primary_key = 'cate_design_id';
	protected $col_sort_order = 'cate_design_sort_order';
	protected $sorting = array('cate_design_id' => 'desc');
	
	public function get()
	{
		$this->db->from($this->table_name);
		$this->db->select('*');
		$this->db->orderby($this->col_sort_order,'desc');
		$this->db->orderby($this->primary_key,'desc');
		$query = $this->db->get();
		return $query->result_array(false);
		
	}
	public function get_with_active($language)
	{
		$this->db->select('*');
		$this->db->from($this->table_name);
		$this->db->join('cate_design_content', 'cate_design_content.cate_design_id', 'cate_design.cate_design_id');
		$this->db->where('cate_design_content.languages_id',$language);
		$this->db->where('cate_design_status','1');
		$this->db->orderby('cate_design.'.$this->col_sort_order,'desc');
		$this->db->orderby('cate_design.'.$this->primary_key,'desc');
		$query = $this->db->get();
		return $query->result_array(false);
		
	}
}
?>